#include "my_head.h"

bool Modifynode(p_flight_node head)
{
    char n[20];
    if (head == NULL)
    {
        printf("error\n");
        return false;
    }
    p_flight_node p = head->next;
    printf("请输入你想要修改航班信息的航班号:");
    scanf("%s", n);
    while (p != NULL && strcmp(n, p->data.flight_Number) != 0)
    {
        p = p->next;
    }
    if (p != NULL)
    {
        printf("请进行航班信息修改！\n");
        sleep(1);
        printf("请修改该航班号信息:");
        scanf("%s", p->data.flight_Number);
        printf("请修改该航班机型信息:");
        scanf("%s", p->data.aircraft_Model);
        printf("请修改该航班预计起飞时间信息:");
        scanf("%s", p->data.departure_Time);
        printf("请修改该航班预计降落时间信息:");
        scanf("%s", p->data.arrival_Time);
        printf("请修改该航班班期信息:");
        scanf("%s",p->data.flight_Schedule);
        printf("请修改该航班起飞机场信息:");
        scanf("%s", p->data.departure_Airport);
        printf("请修改该航班目的机场信息:");
        scanf("%s", p->data.arrival_Airport);
        printf("修改成功！\n");
        printf("=================\n");
        return true;
    }
    else
    {
        printf("未找到该航班信息！\n");
        printf("=================\n");
        return false;
    }
}